/*
 * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 *
 * This file is part of Harmattan SmashMiner OpenGL game application.
 * 
 * Harmattan SmashMiner OpenGL Example Application version 1.0.0
 *  
 * Latest update: 15.4.2011
 *
 * The Harmattan SmashMiner OpenGL example application demonstrates how to use 
 * the OpenGL ES in Harmattan devices.
 *
 * This example is provided as a starting point for 3rd party
 * developers (you) to ease the implementation of OpenGL based 
 * games. Ideas, parts of code or methodologies that this
 * example application uses can be freely used without restrictions.
 *
 * See file README.txt how to build and compile this example application
 * in the Harmattan SDK environment. 
 * 
 * See file INSTALL.txt to find out what is required to run this
 * application and how to install the application to the device or
 * alternatively in QEMU-emulator.
 *
 * The LICENSE.txt file explains the license this software is provided
 * with. A copy of the same license is included in this source file.
 * 
 */

/*
 * Copyright (C) 2011 by Nokia Corporation.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

#ifndef COLLECTIBLE_H
#define COLLECTIBLE_H

#include "defines.h"     // include this before anything else.
#include "gameobject.h"
#include "rotatingobject.h"

class Collectible : public WrappingGameObject
{
public:
    enum {
        /// MineralA lifecycle
        LifeCycleMineralA = 2500
    };
    enum {
        /// MineralB lifecycle
        LifeCycleMineralB = 1500
    };
    enum {
        /// MineralC lifecycle
        LifeCycleMineralC = 1000
    };
    enum {
        /// MineralD lifecycle
        LifeCycleMineralD = 600
    };
    enum {
        /// Bomb lifecycle
        LifeCycleBomb = 900
    };
    enum {
        /// HyperJump lifecycle
        LifeCycleHyperJump = 9000
    };

    Collectible(GameObjectType type, int frame, FPtype gameObjectRadius, 
                SpeedLimit gameObjectSpeedLimit, bool rewindEnabled, GameObjectMass mass, 
                ScoreValue value, int lifeCycleFrames);

    bool lifeCycleLeft(int frames) const;

    /// Sets lifecycle of the collectible as \a frames.
    inline void setLifeCycle(int frames) { lifeCycleInFrames = frames; }

    
private:
    /// Lifecycle of collectible as frames
    int lifeCycleInFrames;
};

class HyperJump : public Collectible
{
public:
    HyperJump(int frame, bool rewindEnabled, FPtype radius);
};

class Bomb : public Collectible
{
public:
    Bomb(int frame, bool rewindEnabled, FPtype radius);
};

class RotatingCollectible : public Collectible, public RotatingObject
{
public:
    RotatingCollectible(GameObjectType type, int frame, FPtype gameObjectRadius, 
                        SpeedLimit gameObjectSpeedLimit, bool rewindEnabled, GameObjectMass mass, 
                        ScoreValue value, int lifeCycleFrames);
};

class Mineral : public RotatingCollectible 
{
public:
    Mineral(GameObjectType type, int frame, SpeedLimit gameObjectSpeedLimit, 
            bool rewindEnabled, ScoreValue scoreValue, int lifeCycleFrames);

};

class MineralA : public Mineral
{
public:
    MineralA(int frame, bool rewindEnabled);

};

class MineralB : public Mineral
{
public:
    MineralB(int frame, bool rewindEnabled);

};

class MineralC : public Mineral
{
public:
    MineralC(int frame, bool rewindEnabled);

};

class MineralD : public Mineral
{
public:
    MineralD(int frame, bool rewindEnabled);

};

#endif // COLLECTIBLE_H
